﻿@model ContentSliderSettings
@using CAF.Infrastructure.Core.Domain.Cms;
@using CAF.WebSite.Application.WebUI.Themes;

@{
    var isActive = Model.IsActive && Model.Slides.Where(x => x.Published).Any();
    var files = "";
    if (isActive)
    {
        //Html.AddCssFileParts(false, Html.ThemePath("Content/slider.less"));
        //Html.AddScriptParts("~/bundles/sequencejs");
        foreach (ContentSliderSlideSettings slide in Model.Slides)
        {
            if (!string.IsNullOrEmpty(slide.BackgroundPictureUrl))
                files += Url.Content(slide.BackgroundPictureUrl) + "|";
        }
    }


}

@if (isActive)
{

    <banner>
        <div class="BAN--bj">
            <div class="BAN--top center"></div>
            <div class="BAN--flash-bg">

                <div class="width BAN--flash">
                    <div class="flash">
                        <script type="text/javascript">
                            var swf_width = 1000;
                            var swf_height = 320;
                            var files = '@files.TrimEnd('|')';
                            var links = '||';
                            var texts = '';
                            var swfpath = '/Themes/AlphaCosmetics/Content/js/flash02.swf';
                            var AutoPlayTime = 6; //间隔时间：单位是秒
                            document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + swf_width + '" height="' + swf_height + '">');
                            document.write('<param name="movie" value=' + swfpath + '><param name="quality" value="high">');
                            document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
                            document.write('<param name="FlashVars" value="bcastr_file=' + files + '&bcastr_link=' + links + '&bcastr_title=' + texts + '&AutoPlayTime=' + AutoPlayTime + '">');
                            document.write('<embed src=' + swfpath + ' wmode="opaque" FlashVars="bcastr_file=' + files + '&bcastr_link=' + links + '&bcastr_title=' + texts + '&AutoPlayTime=' + AutoPlayTime + '" menu="false" quality="high" width="' + swf_width + '" height="' + swf_height + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
                            document.write('</object>');
                        </script>
                    </div>
                </div>

            </div>
            <div class="clear"></div>
        </div>
    </banner>

}